.home-container {
  min-height: 100vh;
  background: linear-gradient(180deg, #e3f2fd 0%, #f0f7ff 40%, #ffffff 100%);
  background-attachment: fixed;
}

.header {
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px 0;
}

.logo img {
  width: 60px;
  height: auto;
  border-radius: 8px;
}

.search-bar {
  display: flex;
  align-items: center;
  background: #f0f0f0;
  border-radius: 20px;
  padding: 8px 15px;
  flex: 1;
  max-width: 600px;
  margin: 0 20px;
  position: relative;
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  padding: 0 8px;
  color: #666;
}

.search-bar input::placeholder {
  color: #999;
}

.category-select {
  position: relative;
  padding: 8px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  width: 90px;
  color: #666
}

.category-select::after {
  content: "▼";
  font-size: 12px;
  color: #666;
}

.category-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 100%;
  z-index: 1000;
  padding: 10px 0;
}

.category-item {
  padding: 8px 20px;
  cursor: pointer;
  transition: background 0.2s;
  color: #333;
}

.category-item:hover {
  background-color: #f5f5f5;
}

.category-item.active {
  color: #007bff;
  font-weight: bold;
}

.header-right {
  display: flex;
  gap: 15px;
  align-items: center;
}

.btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.btn:hover {
  background: #f5f5f5;
}

.cart-list {
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1000px;
  margin: 40px auto;
}

.cart-item {
  background: white;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  align-items: center;
  display: grid;
  grid-template-columns: 40px 100px 1fr auto;
  gap: 20px;
}

.cart-header {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto 20px;
  padding: 0 20px;
}

.select-all {
  font-size: 14px;
  color: #333;
}

/* 商品项中的复选框 */
.item-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
}

.item-image {
  width: 100px;
  height: 100px;
  background: #f0f0f0;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.item-image img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  color: #999;
}

.item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.item-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
}

.item-price {
  font-size: 16px;
  color: #ff5500;
  font-weight: bold;
  margin-bottom: 8px;
}

.item-desc {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.item-purchase {
  font-size: 14px;
  color: #999;
}

.item-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-btn {
  padding: 10px 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  text-align: center;
  transition: background 0.2s;
}

.action-btn:hover {
  background: #f5f5f5;
}

/* 搜索历史下拉框 */
.search-history-dropdown {
  position: absolute;
  top: 100%;
  left: 18px;
  right: 18px;
  background: #f0f0f0;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 999;
  max-height: 200px;
  overflow-y: auto;
}

.search-history-item {
  padding: 10px 15px;
  cursor: pointer;
  color: #333;
  font-size: 14px;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.2s;
}

.search-history-item:hover {
  background: #f0f7ff;
}

.search-history-item:last-child {
  border-bottom: none;
}

.clear-history {
  color: #000;
  text-align: center;
  border-top: 1px solid #eee;
  margin-top: 8px;
}

.no-record {
  padding: 10px;
  text-align: center;
  color: #999;
}

/* 响应式 */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 15px;
  }

  .search-bar {
    max-width: 100%;
  }

  .cart-item {
    grid-template-columns: 40px 1fr;
  }

  .item-image {
    width: 100%;
    height: 100px;
  }

  .item-actions {
    width: 100%;
    align-items: stretch;
  }

  .item-image,
  .item-actions {
    grid-column: span 2;
    justify-self: center;
  }
}


/* 加载状态 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-spinner {
  background: white;
  padding: 20px 40px;
  border-radius: 8px;
  font-size: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* 空购物车 */
.empty-cart {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-cart p {
  font-size: 18px;
  margin-bottom: 20px;
}

.empty-cart .btn {
  padding: 10px 30px;
  background: #ff6b6b;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.empty-cart .btn:hover {
  background: #ff5252;
}

/* 购物车摘要 */
.cart-summary {
  display: flex;
  align-items: center;
  margin-left: auto;
  font-size: 18px;
  font-weight: bold;
  color: #ff6b6b;
}

/* 数量控制 */
.quantity-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
}

.quantity-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
  border-radius: 4px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.quantity-btn:hover:not(:disabled) {
  background: #f5f5f5;
  border-color: #ff6b6b;
}

.quantity-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.quantity-input {
  width: 60px;
  height: 30px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* 删除按钮 */
.delete-btn {
  background: #ffc9c9b3;
  color: rgb(0, 0, 0);
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.delete-btn:hover {
  background: #cc0000;
}

/* 商品图片 */
.item-image img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
}

/* 商品操作区域 */
.item-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-left: auto;
}

/* 立即购买按钮 */
.buy-btn {
  background: #bbf9c1;
  color: rgb(0, 0, 0);
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.buy-btn:hover {
  background: #ff5252;
}

/* 顶部导航的容器 */
.nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* 导航项样式 */
.nav-item {
  color: #333;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  font-size: 16px;
}

.nav-item:hover {
  background: #f5f5f5;
  color: #000;
  border-bottom: 2px solid #007bff;
  padding-bottom: 4px;
}

/* 选中/激活状态*/
.nav-item.active,
.nav-item.router-link-active {
  color: #007bff;
  font-weight: 600;
  background: rgba(0,123,255,0.06);
}